#pragma once

#include "lg.h"
#include "lg_init.h"
#include "lg_ref.h"

typedef struct {
	char* data;
	size_t size;
}LGShaderSource;

struct LGShader {
	LGRef ref;
	LGShaderSource vs[LGSHADER_MAX_SOURCE];
	LGShaderSource fs[LGSHADER_MAX_SOURCE];
	unsigned vsCount;
	unsigned fsCount;
};


struct LGShaderBackend{
	size_t (*sizeofShader)();
	int (*newShader)(LGShader* shader);
	void (*freeShader)(LGShader* shader);
    int (*compileShader)(LGShader* shader, const char** err);
};


LG_API int
lgInitShaderContext(LGConfig* config, LGShaderBackend* backend);
